#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
int main() {
    pid_t pid = fork();
    if (pid < 0) {
        perror("Fork failed");
        return 1;
    } else if (pid == 0) { // 子进程
        execlp("receiveSignal", "receiveSignal", NULL); // 假设接收信号的程序名为receivesignal
        perror("execlp failed"); // 如果执行失败，打印错误
        return 1;
    } else { // 父进程
        printf("Sending SIGINT to child process...\n");
        kill(pid, SIGINT); // 发送SIGINT信号给子进程
        wait(NULL); // 等待子进程结束
        printf("Child process exited.\n");
    }
    return 0;
}